package scala_base

import Array._



object learn {

  def main(args: Array[String]): Unit = {
//    fuc();

    fuc_arr();


  }

  private def fuc_set(): Unit ={
    val site:List[String]=List("a","b","c");



  }

  private def fuc_arr(): Unit ={

    val array_1=new Array[String](10);

    val array_2=Array("java","scala","spark");

    val myList = Array(1.9, 2.9, 3.4, 3.5)

    for(x<- array_2){
      println(x);
    }

    var total=0;
    for(i<-0 to (myList.length-1)){
      total+=i;
    }
    println(total)


    val marix=ofDim[Int](3,3);
    for(i<-0 to 2){
      for(j<-0 to 2){
        marix(i)(j)=j;
      }
    }

    for(i<-0 to 2){
      for(j<-0 to 2){
        print(" " + marix(i)(j));
      }
      println();
    }

    val myList1 = Array(1.9, 2.9, 3.4, 3.5)
    val myList2= Array(1.9, 2.9, 3.4, 3.5)

    val myList3=concat(myList1,myList2);
    for(x<-myList3){
      println(x);
    }

    val range_list=range(10,23,4);
    printList(myList3);

  }


  private def printList(array: Array[Double]): Unit ={
    for(x<-array){
      println(x);
    }
  }

  private def fuc(): Unit ={
    val factor=3;
    val multiplier=(i:Int)=>i*factor
    print(multiplier(3))
  }


}
